home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 51 / Mobiclic51.iso / mac / DATA / COMMUNS / MOBICLIC_MENUS.CST / 00007_Script_gestion des sprites < prev    next >
Text File  |  2003-01-30  |  6KB  |  213 lines

  1. -- procΘdures utilitaires
  2.  
  3. global volumeOn, sonEnCours, menusActifs, menuOuvert, traitLiaison
  4. -- volumeOn : indique si la fenΩtre de rΘglage du volume est active
  5. -- sonEnCours : contient le nom du dernier son jouΘ
  6.  
  7. -- gestion des rollOver
  8. -- sur une image sans curseur perso
  9. on glisserSur piste1,piste2,ecart1,ecart2
  10.   if volumeOn<>1 and menuOuvert=0 then
  11.     case the paramCount of
  12.       1:-- un seul paramΦtre
  13.         piste2 = piste1
  14.         ecart1=0
  15.         ecart2=0
  16.       2:-- deux paramΦtres
  17.         ecart1=0
  18.         ecart2=0
  19.       3:-- trois paramΦtres
  20.         ecart2=ecart1
  21.     end case
  22.     
  23.     sprite(value(field "PPGS")).locH = the mouseH
  24.     sprite(value(field "PPGS")).locV = the mouseV
  25.     
  26.     repeat with i=piste1 to piste2
  27.       if rollOver(i) and sprite value(field "PPGS") intersects i then
  28.         afficherPistes i+ecart1, i+ecart2
  29.       else
  30.         masquerPistes i+ecart1, i+ecart2
  31.       end if
  32.     end repeat
  33.     -- les pistes de numΘro les plus ΘlevΘs sont prioritaires
  34.     repeat with i= piste2 down to 1+piste1
  35.       if sprite(i+ecart1).visible = 1 then
  36.         repeat with j=piste1 to i-1
  37.           masquerPistes j+ecart1
  38.           if ecart2<>0 then
  39.             masquerPistes j+ecart2
  40.           end if
  41.         end repeat
  42.       end if
  43.     end repeat
  44.   end if
  45. end glisserSur
  46.  
  47. -- sur une image avec curseur doigt et dissimulation de la piste cible
  48. on glisserSurCM piste1,piste2,ecart1,ecart2
  49.   if volumeOn<>1 and menuOuvert=0 then
  50.     case the paramCount of
  51.       1:-- un seul paramΦtre
  52.         piste2 = piste1
  53.         ecart1 = 0
  54.         ecart2 = 0
  55.       2:-- deux paramΦtres
  56.         ecart1 = 0
  57.         ecart2 = 0
  58.       3:-- trois paramΦtres
  59.         ecart2 = ecart1
  60.     end case
  61.     
  62.     sprite(value(field "PPGS")).locH = the mouseH
  63.     sprite(value(field "PPGS")).locV = the mouseV
  64.     
  65.     repeat with i=piste1 to piste2
  66.       if rollOver(i) and sprite value(field "PPGS") intersects i then
  67.         sprite(i+ecart1).cursor = 280
  68.         masquerPistes i
  69.         afficherPistes i+ecart1, i+ecart2
  70.       else
  71.         afficherPistes i
  72.         masquerPistes i+ecart1, i+ecart2
  73.       end if
  74.     end repeat
  75.   end if
  76. end glisserSurCM
  77.  
  78. -- sur une image avec curseur doigt sans dissmulation piste cible
  79. on glisserSurC piste1,piste2,ecart1,ecart2
  80.   if volumeOn<>1 and menuOuvert=0 then
  81.     case the paramCount of
  82.       1:-- un seul paramΦtre
  83.         piste2 = piste1
  84.         ecart1 = 0
  85.         ecart2 = 0
  86.       2:-- deux paramΦtres
  87.         ecart1 = 0
  88.         ecart2 = 0
  89.       3:-- trois paramΦtres
  90.         ecart2 = ecart1
  91.     end case
  92.     
  93.     sprite(value(field "PPGS")).locH = the mouseH
  94.     sprite(value(field "PPGS")).locV = the mouseV
  95.     
  96.     repeat with i=piste1 to piste2
  97.       if rollOver(i) and sprite value(field "PPGS") intersects i then
  98.         sprite(i).cursor = 280
  99.         afficherPistes i+ecart1, i+ecart2
  100.       else
  101.         masquerPistes i+ecart1, i+ecart2
  102.       end if
  103.     end repeat
  104.     -- les pistes de numΘro les plus ΘlevΘs sont prioritaires
  105.     repeat with i= piste2 down to 1+piste1
  106.       if sprite(i+ecart1).visible = 1 then
  107.         repeat with j=piste1 to i-1
  108.           sprite(j+ecart1).visible = 0
  109.           if ecart2<>0 then
  110.             sprite(j+ecart2).visible = 0
  111.           end if
  112.         end repeat
  113.       end if
  114.     end repeat
  115.   end if
  116. end glisserSurC
  117.  
  118. -- sur une image avec Θchange d'acteurs
  119. on glisserSurSwich piste1,piste2,ecart,L1,L2
  120.   -- piste 1 : premiΦre piste du groupe de pistes
  121.   -- piste 2 : derniΦre piste du groupe de pistes
  122.   -- ecart : ecart entre les pistes survolΘes et les pistesmodifiΘes
  123.   -- L1 : liste des numΘros des acteurs occupant initialement les pistes
  124.   -- L2 : liste des numΘros des acteurs occupant les pistes aprΦs substitution
  125.   if volumeOn<>1 and menuOuvert=0 then
  126.     
  127.     sprite(value(field "PPGS")).locH = the mouseH
  128.     sprite(value(field "PPGS")).locV = the mouseV
  129.     
  130.     repeat with i=piste1 to piste2
  131.       if rollOver(i) and sprite value(field "PPGS") intersects i then
  132.         sprite(i).cursor = 280
  133.         sprite(i+ecart).memberNum = L2[i+1-piste1]
  134.       else
  135.         sprite(i+ecart).memberNum = L1[i+1-piste1]
  136.       end if
  137.     end repeat 
  138.   end if
  139. end glisserSurSwich
  140.  
  141. -- masquer des pistes
  142. on masquerPistes
  143.   repeat with i=1 to the paramCount
  144.     if value(param(i))<>0 then
  145.       sprite(param(i)).visible = 0
  146.     else
  147.       listePistes1 param(i),0
  148.     end if
  149.   end repeat
  150. end masquerPistes
  151.  
  152. -- afficher des pistes
  153. on afficherPistes
  154.   repeat with i=1 to the paramCount
  155.     if value(param(i))<>0 then
  156.       sprite(param(i)).visible = 1
  157.     else
  158.       listePistes1 param(i),1
  159.     end if
  160.   end repeat
  161. end afficherPistes
  162.  
  163. -- pistes esclaves
  164. on spritesOn
  165.   repeat with i=1 to the paramCount
  166.     if value(param(i))<>0 then
  167.       puppetSprite (param(i)), true
  168.     else
  169.       listePistes2 param(i),1
  170.     end if
  171.   end repeat
  172. end sprites On
  173.  
  174. on spritesOff
  175.   repeat with i=1 to the paramCount
  176.     if value(param(i))<>0 then
  177.       puppetSprite (param(i)), false
  178.     else
  179.       listePistes2 param(i),0
  180.     end if
  181.   end repeat
  182. end sprites Off
  183.  
  184. -- gestion d'une liste de pistes du type "[premiΦre piste]>[derniΦre piste]"
  185.  
  186. --> pour affichage pistes
  187. on listePistes1 chaine,v
  188.   n = offset(">", chaine)
  189.   n1 = value(chaine.char[1..n-1])
  190.   n2 = value(chaine.char[n+1..chaine.chars.count])
  191.   repeat with j=n1 to n2
  192.     sprite(j).visible = v
  193.   end repeat
  194. end listePistes1
  195.  
  196. --> pour pistes sprites
  197. on listePistes2 chaine,v
  198.   n = offset(">", chaine)
  199.   n1 = value(chaine.char[1..n-1])
  200.   n2 = value(chaine.char[n+1..chaine.chars.count])
  201.   repeat with j=n1 to n2
  202.     puppetSprite j,v
  203.   end repeat
  204. end listePistes2
  205.  
  206. -- rend visibles toutes les pistes
  207. on ╫
  208.   repeat with i=1 to 200
  209.     afficherPistes i
  210.   end repeat
  211. end
  212.  
  213.